import { Sequelize } from 'sequelize';

const instance = (database: string) => new Sequelize({
  dialect: 'mysql',
  // 设置时区
  timezone: '+08:00',
  host: process.env.MYSQL_HOST,
  port: Number(process.env.MYSQL_PORT),
  username: process.env.MYSQL_USERNAME,
  password: process.env.MYSQL_PASSWORD,
  database,
});

export const Mysql = instance('demo');
